<?php $this->load->view('admin/' . $this->router->fetch_class() . '/_script'); ?>
<li>
  <label for="name"><?php echo $this->lang->line('label.city.name') ?><span>*</span></label>
  <div class="input">
    <input type="text" id="name" 
           value="<?php echo empty($obj["name"]) ? "" : $obj["name"] ?>" name="name">
  </div>
</li>
<li>
  <label for="country_id"><?php echo $this->lang->line('label.city.country_id') ?><span>*</span></label>
  <div class="input">
    <select id="country_id" name="country_id" class="chzn chzn-done" style="visibility: visible;">
      <option value="0">
        <?php echo $this->lang->line('label.option.select') ?>
      </option>
      <?php
      $ref_objs = $this->country_model->get_all();
      foreach ($ref_objs as $ref) {
        ?>
        <option value="<?php echo $ref["id"] ?>"
                <?php echo empty($obj["country_id"]) || $obj["country_id"] != $ref["id"] ? "" : 'selected="selected"' ?>>
                  <?php echo $this->country_model->to_string($ref) ?>
        </option>
      <?php } ?>
    </select>
  </div>
</li>
<li>
  <label for="state_id"><?php echo $this->lang->line('label.city.state_id') ?><span>*</span></label>
  <div class="input">
    <select id="state_id" name="state_id" class="chzn chzn-done" style="visibility: visible;">
      <option value="0">
        <?php echo $this->lang->line('label.option.select') ?>
      </option>
      <?php
      $ref_objs = $this->state_model->get_all();
      foreach ($ref_objs as $ref) {
        ?>
        <option value="<?php echo $ref["id"] ?>"
                <?php echo empty($obj["state_id"]) || $obj["state_id"] != $ref["id"] ? "" : 'selected="selected"' ?>>
                  <?php echo $this->state_model->to_string($ref) ?>
        </option>
      <?php } ?>
    </select>
  </div>
</li>
<li>
  <label for="lat">
  <?php echo $this->lang->line('label.city.lat') ?> / <?php echo $this->lang->line('label.city.lng') ?>
  </label>
  <div class="input">
    <input type="text" id="lat" 
           value="<?php echo empty($obj["lat"]) ? "" : $obj["lat"] ?>" name="lat">
    <input type="text" id="lng" value="<?php echo empty($obj["lng"]) ? "" : $obj["lng"] ?>" name="lng">
  </div>
</li>
<li>
  <label for="map">&nbsp;</label>
  <div class="input">
    <div id="map" style="width: 460px;height:300px"></div>
  </div>
</li>